home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 6: Level 6
/
17 Bit - Level 6 (1998)(Epic Marketing)[!].iso
/
quartz
/
q0867.dms
/
q0867.adf
/
TRAPDOOR.LZH
/
Rexx
/
TrimAreas.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-10-14
|
2KB
|
55 lines
/* Trim all Fidonet message areas
Usage: rx TrimAreas <dir>
Your message area directories should be in a separate subdirectory.
The filenotes of the individual message directories should contain
the words "Days xx;", where xx is the number of days that messages
should be kept in that area.
All subdirectories in the specified <dir> will be trimmed.
*/
CSI = '9b'x
OFF = CSI'0m'
BO = CSI'1m'
UL = CSI'4m'
KEOL = CSI'K'
CR = '0d'x
LF = '0a'x
total = 0
trimmed = 0
dir = strip(arg(1))
call writeln(stdout, 'Trimming message areas...')
call writech(stdout, 'Scanning areas...')
address command 'list >t:TrimAreas.Area' dir 'dirs lformat "%s%s"'
address command 'sort t:TrimAreas.Area to t:TrimAreas'
if open(areas,'t:TrimAreas','r') then do
do while ~eof(areas)
area = readln(areas)
call writech(stdout, CR||KEOL||'Area' area)
total = total+1
comment = subword(statef(area),8)
wp=find(comment,'Days')
if wp~=0 then do
trimmed = trimmed+1
days=strip(subword(comment,wp+1),'T',';')+0
call writech(stdout, ',' days 'days')
date=space(date('n',date('i')-days),1,'-')
date=left(overlay(substr(date,10,2),date,8,2),9)
call writech(stdout, ',' date)
address command 'list >t:TrimAreas.Area' area'/(0|1|2|3|4|5|6|7|8|9)#?.MSG upto' date 'lformat "delete %s%s quiet"'
address command 'execute t:TrimAreas.Area'
end
end
close(areas)
say CR||total 'areas,' trimmed 'trimmed.'||KEOL
address command "delete t:TrimAreas t:TrimAreas.Area quiet"
end
else
say LF'Cannot open temporary file t:TrimAreas'
return 0